package com.bluesky.javawebbrowser.domain.html.tags.form.input;

public enum InputType {
	TEXT {
		@Override
		public Input upgrade(Input input) {
			if (input instanceof Text)
				return input;

			return new Text(input);
		}
	},
	PASSWORD {
		@Override
		public Input upgrade(Input input) {
			if (input instanceof Password)
				return input;

			return new Password(input);
		}
	},
	CHECKBOX {
		@Override
		public Input upgrade(Input input) {
			if (input instanceof CheckBox)
				return input;

			return new CheckBox(input);
		}
	},
	RADIO, SUBMIT {
		@Override
		public Input upgrade(Input input) {
			if (input instanceof Submit)
				return input;

			return new Submit(input);
		}
	},
	RESET, FILE, HIDDEN, IMAGE, BUTTON {
		@Override
		public Input upgrade(Input input) {
			if (input instanceof Button)
				return input;

			return new Button(input);
		}
	};

	public Input upgrade(Input input) {
		return input;
	}
}
